]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
pageIndicators: Defer IN animation until redraw
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 4 Aug 2019 23:02:38 +0000 (01:02 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 6 Aug 2019 18:50:43 +0000 (20:50 +0200)
Unlike Tweener, which doesn't know or care about actor state, Clutter
will skip implicit animations on actors that aren't mapped. This makes
sense of course, but it will break the page indicator animation we
do on map: When we get notified about the container being mapped, the
individual indicators (which are the actors being animated) are still
unmapped.

Resolve this by deferring the animation to a LaterFunc.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

js/ui/pageIndicators.js

index 05a535e75b9cbf31b9ce78a4beaa9147713bc35b..c28e001e8c9e6b679fb07d580268e867ab7a9619 100644 (file)
@@ -1,7 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 /* exported PageIndicators, AnimatedPageIndicators */
 
-const { Clutter, GObject, St } = imports.gi;
+const { Clutter, GLib, GObject, Meta, St } = imports.gi;
 
 const Tweener = imports.ui.tweener;
 const { ANIMATION_TIME_OUT, ANIMATION_MAX_DELAY_OUT_FOR_ITEM, AnimationDirection } = imports.ui.iconGrid;
@@ -97,7 +97,15 @@ class AnimatedPageIndicators extends PageIndicators {
         super._init(true);
 
         this.connect('notify::mapped', () => {
-            this.animateIndicators(AnimationDirection.IN);
+            if (!this.mapped)
+                return;
+
+            // Implicit animations are skipped for unmapped actors, and our
+            // children aren't mapped yet, so defer to a later handler
+            Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
+                this.animateIndicators(AnimationDirection.IN);
+                return GLib.SOURCE_REMOVE;
+            });
         });
     }